package it.gestionedocumentale.spring.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyServiceFactory {
	
	private static ApplicationContext ctx;

	static {
		try {

			ctx = new ClassPathXmlApplicationContext("\\it\\gestionedocumentale\\spring\\applicationContext.xml");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static UtenteService getUtenteService() {

		return (UtenteService) ctx.getBean("utenteservice");

	}
	

	public static GruppoService getGruppoService() {

		return (GruppoService) ctx.getBean("grupposervice");

	}
	
	public static ProfiloService getProfiloService() {

		return (ProfiloService) ctx.getBean("profiloservice");

	}
	

	public static TagService getTagService() {

		return (TagService) ctx.getBean("tagservice");

	}
	

	public static ClassificazioneService getClassificazioneService() {

		return (ClassificazioneService) ctx.getBean("classificazioneservice");

	}
	
	public static DocumentoService getDocumentoService() {

		return (DocumentoService) ctx.getBean("documentoservice");

	}

}
